import launch
import launch_ros

from launch import LaunchDescription
from launch_ros.actions import Node
from ament_index_python.packages import get_package_share_directory


def generate_launch_description():

    TF_pkg_share_dir = get_package_share_directory('TF')

    default_rviz_path = TF_pkg_share_dir + '/configs/default.rviz'

    TF_node = Node(
        package='TF',
        executable='TF',
        name='TF',
        output='screen',
        parameters=[
        ],
    )
    
    # 启动 rviz2 节点
    rviz2_node = Node(
        package='rviz2',
        executable='rviz2',
        output='screen',
        arguments=['-d', default_rviz_path]
    )
    return LaunchDescription([
        TF_node,
        rviz2_node
    ])
